******************
**** Table B5 ****
****************** 


use "$data/telephone_surveydata_ready" , clear

** Matching on pre-treatment values **
gen ebalancematch=.
replace ebalancematch=0 if treatmentidentitynew==1 & above==0
replace ebalancematch=1 if treatmentidentitynew==2 & above==0

log using "$output/table b5", replace


cd "$temp"
ebalance ebalancematch preratiow1 lastdebt_demeanedw1 collectiv pc i.ebal_highvisible prepaymentsmadedummy* teamdummy*, target(2)  k(baltable_1) rep
bysort id_survey: egen entropy_weight_1=mean(_webal)


gen ebalancematch2=.
replace ebalancematch2=0 if treatmentidentitynew==1 & above==0
replace ebalancematch2=1 if treatmentidentitynew==3 & above==0

ebalance ebalancematch2 preratiow1 lastdebt_demeanedw1 collectiv pc i.ebal_highvisible prepaymentsmadedummy* teamdummy*, target(2)  k(baltable_2) rep
bysort id_survey: egen entropy_weight_2=mean(_webal)

log close

save "$temp/telephone_surveydata_ready" , replace

